package day09.task.carRental;

public abstract class Carcompany {
    private String No;//车牌号
    private String color;//颜色
    private double mileage;//里程
    private String Brand;//品牌

    public abstract int vehicleRental(int days);
}
class Car extends Carcompany {
    int rentTime;//租车时间
    int number;//租车数量
    int rent;//租金

    Car(int no,int type){
        if(type==1){
            this.rent=600;
        }else if(type==2){
            this.rent=500;
        }else{
            this.rent=300;
        }
        this.number=no;
    }
    public int vehicleRental(int n) {
        return rent* n * number;
    }
}

class Bus extends Carcompany {
    int rentTime;//租车时间
    int number;//租车数量
    int rent;//租金
    int seatCount;
    Bus(int m,int n){
        if(n<=16){
            rent=800;
        }else{
            rent=1500;
        }
        this.number=m;
    }

    public int vehicleRental(int days) {
        return days * rent * number;
    }
}
